import React,{useState} from 'react'
import ReactDom from 'react-dom/client'
import UseMemo from './UseMemo'
import UseReducer from './UseReducer'
// 利用函数组件和hooks语法来实现 类组件中获取动态数据
const App =()=>{
  const [flag,setFlag]=useState(true)
  return(
    <div>
      {/* {flag&&<UseMemo></UseMemo>} */}
      {flag&&<UseReducer></UseReducer>}
      <button onClick={()=>setFlag(!flag)}>toggole</button>
    </div>
  )
}
const root=ReactDom.createRoot(document.querySelector('#root'))
root.render(<App></App>)